public class ch13 {
    public static void main(String[] args) {
        String[] strs = {"A", "B", "C", "D"};
        for (int i = 0; i < strs.length; i++) {
            String a = strs[i];
            for (int j = 0; j < strs.length; j++) {
                String b = strs[j];
                for (int k = 0; k < strs.length; k++) {
                    String c = strs[k];
                    for (int l = 0; l < strs.length; l++) {
                        String d = strs[l];
                        String str = a + b + c + d;
                        System.out.println(str);
                    }
                }
            }
        }
    }
}